<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends DQ_Controller 
{
    public function __construct()
    {
        parent::__construct();
    }

	public function index()
	{
        if($this->session->userdata('uid'))
        {
            redirect('user/?uid='.$this->session->userdata('uid'), 'refresh');
        }
        else
        {
		    $this->load->view('common/login',array('login_count'=>$this->session->userdata('login_count')));
        }
	}

    public function logout()
    {
        $this->session->unset_userdata('uid');
        redirect('login', 'refresh');
    }
}

